<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
 
</head>
<body>
  <div id="app">
    <ul>
      <li v-for="item in arr">
        {{ item }}
      </li>
    </ul>
    <hr>
    <!-- 得到循环下标 -->
    <ul>
      <li v-for="(item, index) in arr">
        {{ item }}
        --->
        {{index}}
      </li>
    </ul>

    <ul>
      <li v-for="item in person">
        <h5>
          姓名: {{item.name}}
        </h5>
        <p>
          年龄: {{item.age}}
        </p>
        <p>
          性别： {{item.gender}}
        </p>
      </li>
    </ul>
    <!-- 循环对象 不重要 -->
    <ul>
      <li v-for="(value, key, index) in obj">
        {{value}}
        -->{{key}}
        -->{{index}}
      </li>
    </ul>
  </div>
  <script src="./vue.global.js"></script>
  <script>
    const { createApp } = Vue;
    const app = createApp({
      data(){
        return {
          arr: ['a', 'b', 'c', 'd'],
          person: [
            {
              name:'小明',
              age: 18,
              gender: '男'
            },
            {
              name:'小美',
              age: 19,
              gender: '女'
            }
          ],
          obj: {
            a: 10,
            b: 20,
            c: 30
          }
        }
      }
    })
    app.mount('#app')
  </script>
</body>
</html>